package com.dsf.lembda.test.Lambda;

/**
 * @Author: Dgg
 * @Date: 2021/3/16 18:34
 */
public class LambdaDemo1 {
	interface  Printer{
		void  printer(String val);
	}
	public void pringSomething(String something,Printer printer){
			printer.printer(something);
	}

	public static void main(String[] args) {
		LambdaDemo1 lambdaDemo1 = new LambdaDemo1();
		String someThing = "like you every day!";
		/*Printer printer = new Printer() {
			@Override
			public void printer(String val) {
				System.out.println("val:" + val);
			}
		};*/
		/*Printer printer = (String val) ->{
			System.out.println("val:"+val);
		};*/
		/*Printer printer =  val ->{
			System.out.println("val:"+val);
		};*/
		//lembda 表达式简化的形式
		//Printer printer =  val -> System.out.println("val:"+val);
		lambdaDemo1.pringSomething(someThing,val -> System.out.println(val));
	}
}
